home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
United Public Domain Gold 4
/
United Public Domain Gold 4.iso
/
scope
/
sc177.dms
/
sc177.adf
/
DJFilter
/
DJ_Filt.doc
< prev
next >
Wrap
Text File
|
1991-01-03
|
11KB
|
216 lines
DJ_Filt (v1.0) by Steve Anderson DJ_Filt
NAME
dj_filt - Print filter for the DeskJet-500 printer
SYNOPSIS
dj_filt [-e] [ infile [ outfile [ errfile ]]]
or
dj_filt ?
DESCRIPTION
DJ_Filt provides more user control over printing on
DeskJet-500 printers, filtering an input stream to generate
an output. It serves two main functions: (1) If the input
file contains recognized DJ_FILT commands (described below)
DJ_Filt will generate the corresponding PCL codes to control
the DJ-500. (2) If the '-e' flag is specified, DJ_Filt will
strip any existing PCL (Printer Control Language, from HP)
commands from the input file.
Most existing DeskJet printer drivers severely limit how
much the user can control printouts. Generally, no matter
how you have the printer set up (with alternate fonts,
etc.) the driver sends PCL codes to reset it to its default
settings (NOTE: An exception to this is Super_DJ from
CREATIVE FOCUS, which I can recommend even though it
currently provides no features to access the specific
features of the DJ-500). A second probem is that changing
fonts or font characteristics (e.g. point size or pitch)
within a document is difficult or impossible. Although most
of the WYSIWYG word processors (e.g. ProWrite) can provide
relatively good print quality on the DeskJet-500 using
graphics, the built in fonts are much crisper.
DJ_Filt is intended to address both of these probems. You
can use a simple editor (no word processor needed) to create
documents that include multiple typefaces, italics, bold,
underlining, any available font sizes. Also, by using the
AmigaDOS 'CMD' command, output from the printer driver can
be sent to a file rather than the printer. This file can
then be processed through DJ_Filt and on to the printer. If
the file contains no DJ_Filt commands or is graphics the
filtering has no effect on the printout (unless the '-e'
flag is used - see below). However, if the file includes
DJ_Filt commands they will automatically be tranlated to the
correct printer codes.
ARGUMENTS
The arguments for DJ_Filt are as follows:
? - Request usage; prints a brief synopsis of the command.
-e - Strip escape sequences. This will cause DJ_Filt to
scan the input file (or stream if using a pipe) and
strip any HP PCL (Printer Control Language) commands
(escape sequences) before passing it to the output.
infile - Input file. Defaults to STDIN.
outfile - Output file. Defaults to STDOUT.
errfile - File for loggin errors. Defaults to STDERR.
Note that all arguments are optional, but the file names
are interpreted in priority order. That is, if only one
file is specified, it will be the input and the output will
be to STDOUT. Likewise if two files are specified the first
will be read as input and the second will be written as
output, and errors will be sent to the console (STDERR).
USAGE
DJ_Filt is used primarily in two ways. First, you can use
the AmigaDOS command 'CMD' to catch data out of your printer
driver, pass it through DJ_Filt, then on to the printer
(example AREXX and AmigaDOS scripts are included with the
DJ_Filt download). The second (and much simpler) way is to
use DJ_Filt from the CLI to pre-process your files. In this
case you would edit and create some file (inserting DJ_Filt
commands to control the DJ-500 output), then run DJ_Filt
to process it. Finally you would send the DJ_Filt output
to the printer directly (i.e. to PAR: or SER:, not to PRT:
- see below).
DJ_FILT COMMANDS
Insert DJ_Filt commands using your normal text editor or
word processor. When DJ_Filt sees these commands in its
input stream, it substitutes the appropriate PCL codes to
control the printer. These commands can set or change the
print characteristics of your file, such as stroke weight
(e.g. bold or not), font, pitch (characters per inch), point
size, and quality (draft or letter).
A string of DJ_Filt commands has the following format:
<Alt-B>xxYxxxYxY<Alt-E>
where Y is one of the DJ_Filt commands (always in upper
case) and the preceding string ('xx') is the argument to
that command (always in lower case or numeric). The
following table indicates what DJ_Filt (v1.0) recognizes:
<Alt-B> - Beginning of command string
<Alt-E> - End of comand string
0B or nB - Bold Off (normal)
1B or bB - Bold
textC - Comment text (must be lower case) is ignored,
but is filtered out.
tF - Times (CG Times) font (DJ-500 only)
gF - Gothic (Letter Gothic) font (DJ-500 only)
cF - Courier font
0I - Italics off
1I - Italics on
nL - Set Lines per inch (LPI) to n (n can be multi-
digit)
pO - Portrait orientation
lO - Landscape Orientation
nP - Set pitch to n CPI (n can be multi-digit)
0Q or dQ - Draft Quality
1Q or lQ - Letter Quality
nS - Set point size to n (n can be multi-digit)
0U - Underline off
1U - Underline on, single line
2U - Underline on, double line
X - Send rest of command string (i.e. up to the
next Alt-E) directly to printer as escape
sequence (escape character is pre-pended). Note
that this is the only command for which the
command comes before the argument. (This command
is for those adventurous enough to try to talk
PCL.)
Notes:
1) Commands are ALWAYS upper case
2) Arguments are ALWAYS lower case or numeric
3) Commands and arguments are checked for syntax, but
checking the validity of the commands for the DeskJet
is up to you.
4) Since I have a DeskJet-500 I only know that these
commands work with that model. However, except for
the Gothic and Times fonts, I believe this same set
should work with the DeskJet or DeskJet Plus.
Examples:
<Alt-B>pO<Alt-E> - Portrait orientation
<Alt-B>lQ<Alt-E> - letter quality
<Alt-B>6L10P12ScF<Alt-E> - 6 lines per inch, pitch = 10
characters per inch (pitch), size = 12
point, courier Font.
<Alt-B>2L set lpi to 2 C<Alt-E> - 2 lines per inch. Rest
up to the C (comment) command has no
effect. Note that only lower case and
numeric info can be in a comment.
<Alt-B>dQX(8U<Alt-C> - draft quality, then send "<ESC>(8U"
to printer (which selects the HP
Roman-8 character set).
NOTES ON USAGE
1) If processing a file, DJ_Filt will first examine the
entire file and attempt to determine if it contains
graphics instead of plain text. This may happen if
(for example) you print it from ProWrite as "Normal"
rather than "Draft" or "NLQ". If the file seems to
be graphics, DJ_Filt will pass it on directly without
performing any filtering. As of this version the
operation of DJ_Filt on graphics data passed in on
STDIN (e.g. through a pipe or redirection) is less
predictable.
2) Don't use the -e flag unless you find that you really
need to. It removes ALL of the PCL sequences that your
word processor and printer driver have inserted. While
this prevents the unwanted reset of the printer, it also
will remove any nice italics, bold, or underlining that
have been inserted. It is usually safe to leave the '-e'
flag out, since any settings that you specify via DJ_Filt
commands will come after (and therefore will override)
the initial commands from the driver.
3) The DeskJet printers have a very specific order of
priority in their commands. Within a single command
string (i.e. between an <Alt-B> and an <Alt-E> DJ_Filt
will send things in the rigth order. However, if you
specify things in separate command strings in the wrong
order or do not specify enought information, you may well
not get what you intended. Although DJ_Filt does some
error checking within its own syntax, it doesn't keep
track between strings, and it doesn't attempt to predict
"what you really meant to do". Check your DeskJet-500
Manual for priorities, but in general, make sure you
specify the pitch ('P' command) and point-size ('S')
before the font ('F'), and make sure that the pitch and
point that you select is OK for the font you want.
4) I have done this program mainly because I wanted it. I've
done this document because I thought someone else might
want it. I don't expect to make money on it, but likewise
I don't promise it will do anything you or I intend it
to.
5) Although I have designed it for use with the DJ-500, I
would expect DJ_Filt to work well with the DeskJet and
DeskJet Plus as well. If there is sufficient interest
I will try to provide more commands and features.
6) This program is "FreeWare". Please use it if you wish.
It may be redistributed as long as no profit is made from
its distribution or sale without my permission. If you
feel compelled to reward my efforts ( :-> ) then send me
ink for my DJ-500 (I've used alot in testing this
program!). Send nice comments and / or friendly
suggestions to:
PLink: SNEVL
Compuserve: 74375,1514
Snail Mail: Steve Anderson
1136 11th Street
Manhattan Beach, CA 90266